import request from '@/utils/request'

// 新增菜单数据
export const addMenuData = data => {
  return request({
    url: '/permission/menu',
    method: 'POST',
    data
  })
}

// 根据id获取菜单数据
export const getMenuDataAccordingToId = id => {
  return request({
    url: `/permission/menu/${id}`,
    method: 'GET'
  })
}

// 根据id编辑菜单数据
export const editMenuDataAccordingToId = data => {
  return request({
    url: `/permission/menu/${data.id}`,
    method: 'PUT',
    data
  })
}

// 根据id删除菜单数据
export const deleteMenuDataAccordingToId = id => {
  return request({
    url: `/permission/menu/${id}`,
    method: 'DELETE'
  })
}

// 根据id修改组件显示状态
export const DisplayStatusAccordingToId = (id, hidden) => {
  return request({
    url: `/permission/menu/${id}/${hidden}`,
    method: 'GET'
  })
}
